package com.wntime.simulator.config;

import org.iq80.leveldb.DB;
import org.iq80.leveldb.Options;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.io.File;
import java.io.IOException;

@Configuration
public class LevelDBConfig {

    @Bean
    public DB levelDB() throws IOException {
        Options options = new Options();
        options.createIfMissing(true);
        return org.iq80.leveldb.impl.Iq80DBFactory.factory.open(new File("simulator"), options);
    }
}